﻿<%@ include file="../include/top.jsp"%>
<%@ include file="../include/errorArea.jsp" %>

<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#96b0d5">
  <tr>
    <td height="25" align="center" valign="middle" background="${baseURL}/images/blue_line02.jpg" bgcolor="#FFFFFF">
	    <table width="98%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td width="20" align="left" valign="middle">&nbsp;</td>
	        <td align="left" valign="middle">
	        	<img src="${baseURL}/images/bit_01.png" width="16" height="14" border="0" align="absmiddle" />
	        	&nbsp;<a href="#" class="a2_blue" onclick="window.location = 'toAddSupplier';">添加供货商</a>&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
	      </tr>
	    </table>
    </td>
  </tr>
</table>

  <form action="" method="get" name="searchForm" id="searchForm">
    <input type="hidden" name="p" value="1" />
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
  <tr>
    <td height="5" colspan="2"></td>
  </tr>

    <tr>
      <td height="20" align="left" valign="middle">
      <img src="${baseURL}/images/009.png" width="16" height="16" align="absmiddle" />
      &nbsp;搜索条件：&nbsp;
      </td>
    </tr>
    <tr>
      <td height="20" align="left" valign="middle">  
      	名称：
        <input name="keyword" type="text" class="button" id="keyword"
			value="${formdata.keyword}" size="20"/>
		联系人：
        <input name="contact" type="text" class="button" id="contact"
			value="${formdata.contact}" size="20"/></td>
    </tr>
    <tr>
      <td height="20" align="center" valign="middle">
      <input name="image" type="image" id="Image8" onmouseover="MM_swapImage('Image8','','${baseURL}/images/button_ss_a.jpg',1)" onmouseout="MM_swapImgRestore()" src="${baseURL}/images/button_ss.jpg"/>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <img src="${baseURL}/images/button_qk.jpg" name="clearButton" id="clearButton" style="cursor:pointer" onclick="clearInput()" onmouseover="MM_swapImage('clearButton','','${baseURL}/images/button_qk_a.jpg',1)" onmouseout="MM_swapImgRestore()"/>
      </td>
    </tr>
  <tr>
    <td height="5" colspan="2"></td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#A6CAE8"></td>
  </tr>
  <tr>
    <td height="5" colspan="2" class="text_gray2"></td>
  </tr>
</table>
  </form>
<script>
function clearInput() {
	document.getElementById("keyword").value = "";
	document.getElementById("contact").value = "";
}

function selectAll(checkAllFlag) {
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		checkArray[i].checked = checkAllFlag;
	}
}
</script>
<c:if test="${empty obj.list}">
<div align="center"><b>没有符合条件的记录。</b></div>
</c:if>
<c:if test="${not empty obj.list}">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" id="listOutTable">
  <tr>
    <td colspan="2" align="left" valign="middle" class="text_gray2"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#96bee2">
      <tr>
        <td height="21" background="${baseURL}/images/table_bg.jpg">&nbsp;&nbsp;
        <span class="text_blue_b">
        <img src="${baseURL}/images/008.png" width="16" height="16" align="absmiddle" />&nbsp;供货商列表：</span></td>
      </tr>
      <tr>
        <td height="13" valign="top" bgcolor="#FFFFFF">
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF" id="listTable">
	<tr align="center" bgcolor="#eeeeee">
		<td height="25" width="5%"><input type="checkbox" onclick="selectAll(this.checked);"></td>
		<td width="5%">编号</td>
		<td width="35%">供货商名称</td>
		<td width="8%">联系人</td>
		<td width="8%">地址</td>
		<td width="8%">等级</td>
		<td>操作</td>
	</tr>
	<c:forEach var="oneRow" items="${obj.list}">
		<tr align="center">
			<td><input name="chk" type="checkbox" id="chk" value="${oneRow.id}" /></td>
			<td>${oneRow.id}</td>
			<td align="left">${oneRow.supplierName}</td>
			<td>${oneRow.contact}</td>
			<td>${oneRow.address}</td>
			<td>${oneRow.grade}</td>
			<td>
				<a href="toEditSupplier?id=${oneRow.id}">[编辑]</a>
				<a href="listUser?p=1&sid=${oneRow.id}">[管理用户]</a>
				<a href="#" onclick="delById('${ctx}',${oneRow.id})">[删除]</a>
			</td>
		</tr>
	</c:forEach>
        </table>
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="5" colspan="2">
    	<input name="button" type="button" onclick="delByIds('${ctx}');" value="批量删除" class="myButton"></td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#A6CAE8"></td>
  </tr>
  <tr>
    <td height="25" colspan="2"><%@ include file="../include/listpage.jsp"%>
    </td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#A6CAE8"></td>
  </tr>
</table>
<script src="${ctx}/js/listSupplier.js"></script>
</c:if>

<%@ include file="../include/bottom.jsp"%>